package com.ly.common.core.bean.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Map;
import java.util.Set;

/**
 * 通用消息入参
 *
 * @author luoyun
 * @Date: 2025/6/09 11:01
 * @Note:
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MsgDTO implements Serializable {

    private static final long serialVersionUID = -5690444483968058442L;

    /**
     * 标题
     */
    private String title;
    /**
     * 内容
     */
    private String msgContent;
    /**
     * 发送人
     */
    private String sender;
    /**
     * 接收人列表
     */
    private String toUser;
    /**
     * 是否全部人
     */
    private Boolean toAll;


    /**
     * 消息类型1:通知公告2:系统消息
     */
    private String msgCategory;
    /**
     * 业务类型(各类通知的访问方式）
     */
    private String busType;
    /**
     * 业务id
     */
    private String busId;

    /**
     * 模版编码
     */
    private String templateCode;
    /**
     * 参数
     */
    private Map<String, Object> params;

    /**
     * 参数-str
     */
    private String paramsStr;

    /**
     * 消息类型: link：MsgTypeEnum
     * {@link:  MsgTypeEnum }
     */
    private String type;
    /**
     * 是否是 markdown
     */
    private Boolean isMarkdown = false;

    private String copyToUser;
    private Set<String> toEmailList;
    private Set<String> ccEmailList;
    private Boolean isTimeJob = false;

    public MsgDTO(String sender, String toUser, String title, String msgContent) {
        this.sender = sender;
        this.toUser = toUser;
        this.title = title;
        this.msgContent = msgContent;
        this.msgCategory = "2";
    }
}